package com.volcreate.week1;

import java.util.Scanner;

/**
 * @author zxc
 * @date 2020/9/20
 */
public class Main2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n;
        while (scanner.hasNextLine()) {
            int sum = 0;
            String line = scanner.nextLine();
            n = Integer.parseInt(line);
            if (n >= 10000 && n <= 20000) {
                System.out.println(Integer.toBinaryString(n) + "," + Integer.toOctalString(n) + "," + Integer.toHexString(n));
            } else {
                char[] chars = line.toCharArray();
                if (chars[0] != '-') {
                    sum += chars[0] - '0';
                    System.out.print(chars[0] + " ");
                }
                for (int i = 1; i < line.length(); i++) {
                    sum += chars[i] - '0';
                    System.out.print(chars[i] + " ");
                }

                System.out.println(sum);
            }
        }
        scanner.close();
    }
}
